package bpm.dao.impl.proposal;
import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import bpm.dao.proposal.ProposalFieldDao;
import bpm.domain.proposal.ProposalField;

@Repository("proposalFieldDao")
public class ProposalFieldDaoImpl implements ProposalFieldDao{
	@Resource
	private JdbcTemplate jdbcTemplate;
	private Logger logger = Logger.getLogger(ProposalFieldDaoImpl.class);
	
	@SuppressWarnings("unchecked")
	public List<ProposalField> getAllField() {
		
		String SearchSQL = " select FIELD_KEY, FIELD_NAME,DOC_DEF_ID, DOC_FIELD_KEY, DEFAULT_VALUE, CALL_BACK, CALL_BACK_PARAMETER, DESCRIPTION  from BPM_PL_FIELD ";
		logger.debug(SearchSQL);
		return this.jdbcTemplate.query(SearchSQL, new ProposalFieldMapper());
	}

}
